package org.dromara.germbank.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 知识表
 * 数据库表名：bus_knowledge
 */
@Data
@TableName("bus_knowledge")
public class BusOperationsKnowledge implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableField("id")
    @NotNull(message = "主键id不能为空")
    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer id;

    @TableField("code")
    @NotBlank(message = "知识编号不能为空")
    @Size(max = 32, message = "知识编号长度不能超过32")
    @Length(max = 32, message = "知识编号长度不能超过32")
    @Schema(description = "知识编号，业务唯一标识", requiredMode = Schema.RequiredMode.REQUIRED)
    private String code;

    @TableField("title")
    @NotBlank(message = "知识标题不能为空")
    @Size(max = 200, message = "知识标题长度不能超过200")
    @Length(max = 200, message = "知识标题长度不能超过200")
    @Schema(description = "知识标题", requiredMode = Schema.RequiredMode.REQUIRED)
    private String title;

    @TableField("summary")
    @Size(max = 65535, message = "知识摘要长度超限")
    @Length(max = 65535, message = "知识摘要长度超限")
    @Schema(description = "知识摘要")
    private String summary;

    @TableField("creator")
    @NotBlank(message = "创建者不能为空")
    @Size(max = 64, message = "创建者长度不能超过64")
    @Length(max = 64, message = "创建者长度不能超过64")
    @Schema(description = "创建者", requiredMode = Schema.RequiredMode.REQUIRED)
    private String creator;

    @TableField("created_at")
    @NotNull(message = "创建时间不能为空")
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createdAt;

    @TableField("published_at")
    @Schema(description = "发布时间")
    private LocalDateTime publishedAt;

    @TableField("status")
    @NotBlank(message = "发布状态不能为空")
    @Size(max = 20, message = "发布状态长度不能超过20")
    @Length(max = 20, message = "发布状态长度不能超过20")
    @Schema(description = "发布状态：DRAFT/REVIEW/PUBLISHED/OFFLINE/ARCHIVE", requiredMode = Schema.RequiredMode.REQUIRED)
    private String status;

    @TableField("create_time")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField("update_time")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @TableField("del_flag")
    @Schema(description = "删除标志：0-存在，1-删除")
    private Integer delFlag;


}
